package cn.wanho.listener;

import cn.wanho.exapnd.SheetExcel;
import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.event.AnalysisEventListener;

import java.util.ArrayList;
import java.util.List;

/**
 * @author jingxu
 * @date 2022-8-6
 * Excel表的监听类
 */
public class SheetExcelListener extends AnalysisEventListener<SheetExcel> {

    List<SheetExcel> list = new ArrayList<>();

    @Override
    public void invoke(SheetExcel sheetExcel, AnalysisContext analysisContext) {
        list.add(sheetExcel);
    }

    @Override
    public void doAfterAllAnalysed(AnalysisContext analysisContext) {}

    public List<SheetExcel> getData(){
        return list;
    }
}
